﻿using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using testapp.ViewModels;

namespace testapp.Views
{
    public partial class MainWindow : Window
    {
      
        public MainWindow()
        {
             
            InitializeComponent();
            InitializeData();
        }
        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
        }

        private void InitializeData()
        {
            //var dataGrid = this.FindControl<DataGrid>("VillageDataGrid");
            //var villages = new ObservableCollection<VillageInfo>
            //{
            //    new VillageInfo { Code = "康定市", PostalCode = "513301000000", FullName = "康定市", TibetanName = "བཀང་འདིན་" },
            //    new VillageInfo { Code = "姜维乡", PostalCode = "513301205000", FullName = "姜维乡", TibetanName = "ཅང་ཝེ་" },
            //    new VillageInfo { Code = "日安村", PostalCode = "513301205202", FullName = "日安村", TibetanName = "རི་ཨན་" },
            //    // 添加更多数据...
            //};

            //if (dataGrid != null)
            //{
            //    dataGrid.ItemsSource = villages;
            //}
        }

      
        private void OnLogoutClick(object sender, RoutedEventArgs e)
        {
            var loginWindow = new LoginWindow();
            loginWindow.Show();
            this.Close();
        }
    }
   
}